-
Notifications
You must be signed in to change notification settings - Fork 29
fix: remove default values in DTOs that cause value overwrite on update #1802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove default values in DTOs that cause value overwrite on update #1802
Conversation
…-prevent-overwriting
…writing' of https://github.com/SciCatProject/scicat-backend-next into SWAP-4573-remove-default-values-in-dtos-to-prevent-overwriting
Small addition: This will also fix #1688 as it's caused by the same default values. I think we should still consider removing |
…-prevent-overwriting
@HayenNico should I bring it up in the collaboration meeting and ask opinion there? That said, I think that this field is important given that one dataset can have multiple origDatablock and multiple files associated with it |
@nitrosx I did not mean to remove |
Yes I agree with this. I think as we are calculating this on the backend side it is a good idea to remove it from the update and create DTOs and just leave it in the database schema. This removes the possibility to update those fields by mistake and have the backend calculations as the only source of truth when it comes to total size and number of files. I am not sure if I should do that as part of this PR or it can be done separately in another one. @nitrosx let me know what do you think |
…-prevent-overwriting
Remove I would say create an additional PR |
…-prevent-overwriting
…-prevent-overwriting
Description
This PR aims to fix the
size
andnumberOfFiles
fields overwrite in the partial update of a dataset.Motivation
size
andnumberOfFiles
fields were overwritten every time when a partial update on a dataset was performed.Fixes
Changes:
Tests included
Documentation
official documentation info